home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / turric03.zip / TURRIC03.ZIP / PROGS / SHAMBLER.QC < prev    next >
Text File  |  1997-01-30  |  13KB  |  382 lines

  1. /*
  2. ==============================================================================
  3.  
  4. SHAMBLER
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. $cd /raid/quake/id1/models/shams
  10. $origin 0 0 24
  11. $base base        
  12. $skin base
  13.  
  14. $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
  15. $frame stand10 stand11 stand12 stand13 stand14 stand15 stand16 stand17
  16.  
  17. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 
  18. $frame walk8 walk9 walk10 walk11 walk12
  19.  
  20. $frame    run1 run2 run3 run4 run5 run6
  21.  
  22. $frame smash1 smash2 smash3 smash4 smash5 smash6 smash7 
  23. $frame smash8 smash9 smash10 smash11 smash12
  24.  
  25. $frame swingr1 swingr2 swingr3 swingr4 swingr5 
  26. $frame swingr6 swingr7 swingr8 swingr9
  27.  
  28. $frame swingl1 swingl2 swingl3 swingl4 swingl5 
  29. $frame swingl6 swingl7 swingl8 swingl9
  30.  
  31. $frame magic1 magic2 magic3 magic4 magic5 
  32. $frame magic6 magic7 magic8 magic9 magic10 magic11 magic12
  33.  
  34. $frame pain1 pain2 pain3 pain4 pain5 pain6
  35.  
  36. $frame death1 death2 death3 death4 death5 death6 
  37. $frame death7 death8 death9 death10 death11
  38.  
  39. void() sham_stand1    =[    $stand1,    sham_stand2    ] {ai_stand();};
  40. void() sham_stand2    =[    $stand2,    sham_stand3    ] {ai_stand();};
  41. void() sham_stand3    =[    $stand3,    sham_stand4    ] {ai_stand();};
  42. void() sham_stand4    =[    $stand4,    sham_stand5    ] {ai_stand();};
  43. void() sham_stand5    =[    $stand5,    sham_stand6    ] {ai_stand();};
  44. void() sham_stand6    =[    $stand6,    sham_stand7    ] {ai_stand();};
  45. void() sham_stand7    =[    $stand7,    sham_stand8    ] {ai_stand();};
  46. void() sham_stand8    =[    $stand8,    sham_stand9    ] {ai_stand();};
  47. void() sham_stand9    =[    $stand9,    sham_stand10] {ai_stand();};
  48. void() sham_stand10    =[    $stand10,    sham_stand11] {ai_stand();};
  49. void() sham_stand11    =[    $stand11,    sham_stand12] {ai_stand();};
  50. void() sham_stand12    =[    $stand12,    sham_stand13] {ai_stand();};
  51. void() sham_stand13    =[    $stand13,    sham_stand14] {ai_stand();};
  52. void() sham_stand14    =[    $stand14,    sham_stand15] {ai_stand();};
  53. void() sham_stand15    =[    $stand15,    sham_stand16] {ai_stand();};
  54. void() sham_stand16    =[    $stand16,    sham_stand17] {ai_stand();};
  55. void() sham_stand17    =[    $stand17,    sham_stand1    ] {ai_stand();};
  56.  
  57. void() sham_walk1        =[      $walk1,        sham_walk2 ] {ai_walk(10);};
  58. void() sham_walk2       =[      $walk2,        sham_walk3 ] {ai_walk(9);};
  59. void() sham_walk3       =[      $walk3,        sham_walk4 ] {ai_walk(9);};
  60. void() sham_walk4       =[      $walk4,        sham_walk5 ] {ai_walk(5);};
  61. void() sham_walk5       =[      $walk5,        sham_walk6 ] {ai_walk(6);};
  62. void() sham_walk6       =[      $walk6,        sham_walk7 ] {ai_walk(12);};
  63. void() sham_walk7       =[      $walk7,        sham_walk8 ] {ai_walk(8);};
  64. void() sham_walk8       =[      $walk8,        sham_walk9 ] {ai_walk(3);};
  65. void() sham_walk9       =[      $walk9,        sham_walk10] {ai_walk(13);};
  66. void() sham_walk10      =[      $walk10,       sham_walk11] {ai_walk(9);};
  67. void() sham_walk11      =[      $walk11,       sham_walk12] {ai_walk(7);};
  68. void() sham_walk12      =[      $walk12,       sham_walk1 ] {ai_walk(7);
  69. if (random() > 0.8)
  70.     sound (self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);};
  71.  
  72. void() sham_run1       =[      $run1,        sham_run2      ] {ai_run(20);};
  73. void() sham_run2       =[      $run2,        sham_run3      ] {ai_run(24);};
  74. void() sham_run3       =[      $run3,        sham_run4      ] {ai_run(20);};
  75. void() sham_run4       =[      $run4,        sham_run5      ] {ai_run(20);};
  76. void() sham_run5       =[      $run5,        sham_run6      ] {ai_run(24);};
  77. void() sham_run6       =[      $run6,        sham_run1      ] {ai_run(20);
  78. if (random() > 0.8)
  79.     sound (self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);
  80. };
  81.  
  82. void() sham_smash1     =[      $smash1,       sham_smash2    ] {
  83. sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM);
  84. ai_charge(2);};
  85. void() sham_smash2     =[      $smash2,       sham_smash3    ] {ai_charge(6);};
  86. void() sham_smash3     =[      $smash3,       sham_smash4    ] {ai_charge(6);};
  87. void() sham_smash4     =[      $smash4,       sham_smash5    ] {ai_charge(5);};
  88. void() sham_smash5     =[      $smash5,       sham_smash6    ] {ai_charge(4);};
  89. void() sham_smash6     =[      $smash6,       sham_smash7    ] {ai_charge(1);};
  90. void() sham_smash7     =[      $smash7,       sham_smash8    ] {ai_charge(0);};
  91. void() sham_smash8     =[      $smash8,       sham_smash9    ] {ai_charge(0);};
  92. void() sham_smash9     =[      $smash9,       sham_smash10   ] {ai_charge(0);};
  93. void() sham_smash10    =[      $smash10,      sham_smash11   ] {
  94. local vector    delta;
  95. local float     ldmg;
  96.  
  97.     if (!self.enemy)
  98.         return;
  99.     ai_charge(0);
  100.  
  101.     delta = self.enemy.origin - self.origin;
  102.  
  103.     if (vlen(delta) > 100)
  104.         return;
  105.     if (!CanDamage (self.enemy, self))
  106.         return;
  107.         
  108.     ldmg = (random() + random() + random()) * 40;
  109.     T_Damage (self.enemy, self, self, ldmg);
  110.     sound (self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM);
  111.  
  112.     SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right);
  113.     SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right);
  114. };
  115. void() sham_smash11    =[      $smash11,      sham_smash12   ] {ai_charge(5);};
  116. void() sham_smash12    =[      $smash12,      sham_run1       ] {ai_charge(4);};
  117.  
  118. void() sham_swingr1;
  119.  
  120. void(float side) ShamClaw =
  121. {
  122. local vector    delta;
  123. local float     ldmg;
  124.  
  125.     if (!self.enemy)
  126.         return;
  127.     ai_charge(10);
  128.  
  129.     delta = self.enemy.origin - self.origin;
  130.  
  131.     if (vlen(delta) > 100)
  132.         return;
  133.         
  134.     ldmg = (random() + random() + random()) * 20;
  135.     T_Damage (self.enemy, self, self, ldmg);
  136.     sound (self, CHAN_VOICE, "shambler/smack.wav", 1, ATTN_NORM);
  137.  
  138.     if (side)
  139.     {
  140.         makevectors (self.angles);
  141.         SpawnMeatSpray (self.origin + v_forward*16, side * v_right);
  142.     }
  143. };
  144.  
  145. void() sham_swingl1    =[      $swingl1,      sham_swingl2   ] {
  146. sound (self, CHAN_VOICE, "shambler/melee2.wav", 1, ATTN_NORM);
  147. ai_charge(5);};
  148. void() sham_swingl2 =[      $swingl2,      sham_swingl3   ] {ai_charge(3);};
  149. void() sham_swingl3 =[      $swingl3,      sham_swingl4   ] {ai_charge(7);};
  150. void() sham_swingl4 =[      $swingl4,      sham_swingl5   ] {ai_charge(3);};
  151. void() sham_swingl5 =[      $swingl5,      sham_swingl6   ] {ai_charge(7);};
  152. void() sham_swingl6 =[      $swingl6,      sham_swingl7   ] {ai_charge(9);};
  153. void() sham_swingl7 =[      $swingl7,      sham_swingl8   ] {ai_charge(5); ShamClaw(250);};
  154. void() sham_swingl8 =[      $swingl8,      sham_swingl9   ] {ai_charge(4);};
  155. void() sham_swingl9 =[      $swingl9,      sham_run1  ] {
  156. ai_charge(8);
  157. if (random()<0.5)
  158.     self.think = sham_swingr1;
  159. };
  160.  
  161. void() sham_swingr1    =[      $swingr1,      sham_swingr2   ] {
  162. sound (self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM);
  163. ai_charge(1);};
  164. void() sham_swingr2    =[      $swingr2,      sham_swingr3   ] {ai_charge(8);};
  165. void() sham_swingr3 =[      $swingr3,      sham_swingr4   ] {ai_charge(14);};
  166. void() sham_swingr4 =[      $swingr4,      sham_swingr5   ] {ai_charge(7);};
  167. void() sham_swingr5 =[      $swingr5,      sham_swingr6   ] {ai_charge(3);};
  168. void() sham_swingr6 =[      $swingr6,      sham_swingr7   ] {ai_charge(6);};
  169. void() sham_swingr7 =[      $swingr7,      sham_swingr8   ] {ai_charge(6); ShamClaw(-250);};
  170. void() sham_swingr8 =[      $swingr8,      sham_swingr9   ] {ai_charge(3);};
  171. void() sham_swingr9 =[      $swingr9,      sham_run1  ] {ai_charge(1);
  172. ai_charge(10);
  173. if (random()<0.5)
  174.     self.think = sham_swingl1;
  175. };
  176.  
  177. void() sham_melee =
  178. {
  179.     local float chance;
  180.     
  181.     chance = random();
  182.     if (chance > 0.6 || self.health == 600)
  183.         sham_smash1 ();
  184.     else if (chance > 0.3)
  185.         sham_swingr1 ();
  186.     else
  187.         sham_swingl1 ();
  188. };
  189.  
  190.  
  191. //============================================================================
  192.  
  193. void() CastLightning =
  194. {
  195.     local    vector    org, dir;
  196.     
  197.     self.effects = self.effects | EF_MUZZLEFLASH;
  198.  
  199.     ai_face ();
  200.  
  201.     org = self.origin + '0 0 40';
  202.  
  203.     dir = self.enemy.origin + '0 0 16' - org;
  204.     dir = normalize (dir);
  205.  
  206.     traceline (org, self.origin + dir*600, TRUE, self);
  207.  
  208.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  209.     WriteByte (MSG_BROADCAST, TE_LIGHTNING1);
  210.     WriteEntity (MSG_BROADCAST, self);
  211.     WriteCoord (MSG_BROADCAST, org_x);
  212.     WriteCoord (MSG_BROADCAST, org_y);
  213.     WriteCoord (MSG_BROADCAST, org_z);
  214.     WriteCoord (MSG_BROADCAST, trace_endpos_x);
  215.     WriteCoord (MSG_BROADCAST, trace_endpos_y);
  216.     WriteCoord (MSG_BROADCAST, trace_endpos_z);
  217.  
  218.     LightningDamage (org, trace_endpos, self, 10);
  219. };
  220.  
  221. void() sham_magic1     =[      $magic1,       sham_magic2    ] {ai_face();
  222.     sound (self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
  223. };
  224. void() sham_magic2     =[      $magic2,       sham_magic3    ] {ai_face();};
  225. void() sham_magic3     =[      $magic3,       sham_magic4    ] {ai_face();self.nextthink = self.nextthink + 0.2;
  226. local entity o;
  227.  
  228. self.effects = self.effects | EF_MUZZLEFLASH;
  229. ai_face();
  230. self.owner = spawn();
  231. o = self.owner;
  232. setmodel (o, "progs/s_light.mdl");
  233. setorigin (o, self.origin);
  234. o.angles = self.angles;
  235. o.nextthink = time + 0.7;
  236. o.think = SUB_Remove;
  237. };
  238. void() sham_magic4     =[      $magic4,       sham_magic5    ]
  239. {
  240. self.effects = self.effects | EF_MUZZLEFLASH;
  241. self.owner.frame = 1;
  242. };
  243. void() sham_magic5     =[      $magic5,       sham_magic6    ]
  244. {
  245. self.effects = self.effects | EF_MUZZLEFLASH;
  246. self.owner.frame = 2;
  247. };
  248. void() sham_magic6     =[      $magic6,       sham_magic9    ]
  249. {
  250. remove (self.owner);
  251. CastLightning();
  252. sound (self, CHAN_WEAPON, "shambler/sboom.wav", 1, ATTN_NORM);
  253. };
  254. void() sham_magic9     =[      $magic9,       sham_magic10   ]
  255. {CastLightning();};
  256. void() sham_magic10    =[      $magic10,      sham_magic11   ]
  257. {CastLightning();};
  258. void() sham_magic11    =[      $magic11,      sham_magic12   ]
  259. {
  260. if (skill == 3)
  261.     CastLightning();
  262. };
  263. void() sham_magic12    =[      $magic12,      sham_run1       ] {};
  264.  
  265.  
  266.  
  267. void() sham_pain1       =[      $pain1, sham_pain2      ] {};
  268. void() sham_pain2       =[      $pain2, sham_pain3      ] {};
  269. void() sham_pain3       =[      $pain3, sham_pain4      ] {};
  270. void() sham_pain4       =[      $pain4, sham_pain5      ] {};
  271. void() sham_pain5       =[      $pain5, sham_pain6      ] {};
  272. void() sham_pain6       =[      $pain6, sham_run1      ] {};
  273.  
  274. void(entity attacker, float damage)    sham_pain =
  275. {
  276.     sound (self, CHAN_VOICE, "shambler/shurt2.wav", 1, ATTN_NORM);
  277.  
  278.     if (self.health <= 0)
  279.         return;        // allready dying, don't go into pain frame
  280.  
  281.     if (random()*400 > damage)
  282.         return;        // didn't flinch
  283.  
  284.     if (self.pain_finished > time)
  285.         return;
  286.     self.pain_finished = time + 2;
  287.         
  288.     sham_pain1 ();
  289. };
  290.  
  291.  
  292. //============================================================================
  293.  
  294. void() sham_death1      =[      $death1,       sham_death2     ] {};
  295. void() sham_death2      =[      $death2,       sham_death3     ] {};
  296. void() sham_death3      =[      $death3,       sham_death4     ]
  297. {
  298. //** PATCH_BEGIN - gibbin3 ****
  299. //    self.solid = SOLID_NOT;
  300. //** PATCH_END - gibbin3 ******
  301. };
  302. void() sham_death4      =[      $death4,       sham_death5     ] {};
  303. void() sham_death5      =[      $death5,       sham_death6     ] {};
  304. void() sham_death6      =[      $death6,       sham_death7     ] {};
  305. void() sham_death7      =[      $death7,       sham_death8     ] {};
  306. void() sham_death8      =[      $death8,       sham_death9     ] {};
  307. void() sham_death9      =[      $death9,       sham_death10    ] {};
  308. void() sham_death10     =[      $death10,      sham_death11    ] {};
  309. void() sham_death11     =[      $death11,      sham_death11    ] {};
  310.  
  311. void() sham_die =
  312. {
  313. //** PATCH_BEGIN - gibbin3 - Turrican ****
  314. // Pass monster size and head.mdl to Corpse_die using globals.
  315.     self.corpse_size = SIZE_LARGE;
  316.     self.head_gib_name = "progs/h_shams.mdl";
  317. //** PATCH_END - gibbin3 - Turrican ******
  318.  
  319. // check for gib
  320.     if (self.health < -60)
  321.     {
  322. //** PATCH_BEGIN - gibbin3 - Turrican ****
  323.         Corpse_die();
  324. //** PATCH_END - gibbin3 - Turrican ******
  325.         return;
  326.     }
  327.  
  328. // regular death
  329.     sound (self, CHAN_VOICE, "shambler/sdeath.wav", 1, ATTN_NORM);
  330.     sham_death1 ();
  331.  
  332. //** PATCH_BEGIN - gibbin3 - Turrican ****
  333.     MakeCorpse (300, '-48 -48 -24', '48 48 0');
  334. //** PATCH_END - gibbin3 - Turrican ******
  335.  
  336. };
  337.  
  338. //============================================================================
  339.  
  340.  
  341. /*QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush
  342. */
  343. void() monster_shambler =
  344. {
  345.     if (deathmatch)
  346.     {
  347.         remove(self);
  348.         return;
  349.     }
  350.     precache_model ("progs/shambler.mdl");
  351.     precache_model ("progs/s_light.mdl");
  352.     precache_model ("progs/h_shams.mdl");
  353.     precache_model ("progs/bolt.mdl");
  354.     
  355.     precache_sound ("shambler/sattck1.wav");
  356.     precache_sound ("shambler/sboom.wav");
  357.     precache_sound ("shambler/sdeath.wav");
  358.     precache_sound ("shambler/shurt2.wav");
  359.     precache_sound ("shambler/sidle.wav");
  360.     precache_sound ("shambler/ssight.wav");
  361.     precache_sound ("shambler/melee1.wav");
  362.     precache_sound ("shambler/melee2.wav");
  363.     precache_sound ("shambler/smack.wav");
  364.  
  365.     self.solid = SOLID_SLIDEBOX;
  366.     self.movetype = MOVETYPE_STEP;
  367.     setmodel (self, "progs/shambler.mdl");
  368.  
  369.     setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  370.     self.health = 600;
  371.  
  372.     self.th_stand = sham_stand1;
  373.     self.th_walk = sham_walk1;
  374.     self.th_run = sham_run1;
  375.     self.th_die = sham_die;
  376.     self.th_melee = sham_melee;
  377.     self.th_missile = sham_magic1;
  378.     self.th_pain = sham_pain;
  379.     
  380.     walkmonster_start();
  381. };
  382.